Skip to content

A subprogram whose declined draws outnumber its trials fails by name; a dummy handed to what might write it is not read-only - #33

Open
chenyueqi wants to merge 2 commits into
mainfrom
declined-draws-and-escaping-dummies
Open

A subprogram whose declined draws outnumber its trials fails by name; a dummy handed to what might write it is not read-only#33
chenyueqi wants to merge 2 commits into
mainfrom
declined-draws-and-escaping-dummies

Conversation

@chenyueqi

Copy link
Copy Markdown
Member

Closes rows 12, 13 and 14 of #32 -- the three that were on main, from #30.

Declined draws are bounded and repeated (rows 12, 13). differential.bitexact declines a draw the candidate stops or overruns on (SystemExit, IndexError) and one both sides take to NaN, and draws again. It did so up to 24 times a trial, counted the redraws in a per-subprogram metric nothing repeated, and passed once one draw survived: a translation that stopped on inputs the source accepts passed on the survivors. Now:

  • a subprogram whose declined draws outnumber the trials it was compared on fails by name, with the count, the reason of each decline (error stop, subscript past extent, NaN on both sides) and the remedy (ranges, or dims). The reshaped rule, which names the extent, still speaks first.
  • a passing verdict repeats the declined count and reasons in its detail; per-subprogram metrics carry declined by reason beside redrawn.

The whole-trial NaN redraw is kept -- what both sides do after a NaN is the compiler's scheduling -- but it is now counted against the same bound and said aloud.

Read-only is proved, not assumed (row 14). _infer_read_only_intents took a parenthesised reference whose base is not one of this file's subprograms for a subscript, and never walked a function reference, an internal WRITE or an ASSOCIATE; a dummy modified through a use-associated function, which parses exactly like a subscript, was inferred intent(in), dropped from the wrapper's outputs and compared on neither side. The pass now knows the scope's variables (dummies, locals, local parameters, module state): a base it does not name is a call whose variable actuals escape, an expression actual is a temporary and does not, the WRITE unit and the ASSOCIATE selector escape. What cannot be proved read-only stays UNKNOWN, and the gate refuses the routine by name, as before #30.

Held to: full suite (916), mypy, ruff green. Corpus re-run: no unit moves (31/67 mechanical, 433 deferred); minpack's chkder is now named in its unit's detail (19 draws declined, 19 error stop, against 10 trials -- mode takes two of the eight default integer values), a unit already failed on dogleg's moved extents. The intent tightening moves nothing in the corpus.

Tests: the redraw tests now assert the reason and the verdict's mention of it; two new ones hold the bound for an error stop and for NaN; one new interface test holds each escape (function actual, internal WRITE, ASSOCIATE) and each non-escape (array subscript, expression actual).

🤖 Generated with Claude Code

https://claude.ai/code/session_01HYzzevwvTuLBMYjzdHUhGg

chenyueqi and others added 2 commits September 4, 2026 22:49
… a dummy handed to what might write it is not read-only

Three rows of #32 (12, 13, 14), all on main since #30 merged.

* The differential gate declines a draw the candidate stops or overruns
  on (a translated ERROR STOP, a subscript past a dummy's extent) and one
  both sides take to NaN, and draws again. It did so up to 24 times per
  trial, counted the redraws in a per-subprogram metric nobody repeated,
  and passed once one draw survived -- so a translation that stopped on
  inputs the source accepts passed on the survivors, one at a time. Now
  a subprogram whose declined draws outnumber the trials it was compared
  on fails by name, with the count, the reason of each decline (error
  stop, subscript past extent, NaN on both sides) and the remedy: narrow
  the draw with `ranges` or pin `dims`. The reshaped rule, which names
  the extent, still speaks first. A passing verdict repeats the declined
  count and reasons in its detail; the per-subprogram metrics carry
  `declined` by reason beside `redrawn`.

* Read-only intent inference took a parenthesised reference whose base
  is not one of this file's subprograms for a subscript, and never
  walked a function reference, an internal WRITE or an ASSOCIATE. A
  dummy modified through a use-associated function -- which parses
  exactly like a subscript -- was inferred `intent(in)`, dropped from
  the wrapper's outputs and compared on neither side. The pass now knows
  the scope's variables (dummies, locals, local parameters, module
  state); a base it does not name is a call whose variable actuals
  escape, an expression actual is a temporary and does not, and the
  WRITE unit and the ASSOCIATE selector escape. What cannot be proved
  read-only stays UNKNOWN, and the gate keeps refusing the routine by
  name, as it did before #30.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HYzzevwvTuLBMYjzdHUhGg
minpack's chkder takes two of the eight values the default integer range
draws for mode, and was compared on the survivors: 19 draws declined
against 10 trials. It is now named in the unit's detail with the reason
and the remedy (pin mode with `ranges`); the unit was already failed on
dogleg's moved extents. No other unit moves; the per-subprogram metrics
gain `declined` by reason.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HYzzevwvTuLBMYjzdHUhGg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant